import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/core/values/gaps.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/standing_book_page/operating_ledger_page/job_ticket_web_page_page/job_ticket_web_page_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

/// 作业票web网页
class JobTicketWebPagePage extends StatelessWidget {
  JobTicketWebPagePage({super.key});

  final controller = Get.put(JobTicketWebPageController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        // initState: (_) {
        //   controller.initDate(controller.ticketReceiptId);
        // },
        builder: (_) {
          return Scaffold(
            appBar: CustomAppBar(
              titleText: '作业票',
            ),
            body: Column(
              children: [
                AppGaps.vGap12,
                Container(
                  height: 4.w,
                  color: const Color(0xff587DF5),
                ),
                Expanded(
                  child: InAppWebView(
                    initialUrlRequest: controller.url,
                    onWebViewCreated: controller.onWebViewCreated,
                  ),
                ),
              ],
            ),
            // bottomSheet: SizedBox(
            //     height: 50,
            //     child: Container(
            //       margin: const EdgeInsets.only(
            //         top: 5,
            //         bottom: 5,
            //       ),
            //       child: ElevatedButton(
            //         style: ElevatedButton.styleFrom(
            //           backgroundColor: Colors.blue,
            //         ),
            //         onPressed: controller.toJobTicket,
            //         child: const Text(
            //           '附件',
            //           style: TextStyle(
            //             fontSize: 16,
            //             color: Colors.white,
            //           ),
            //         ),
            //       ),
            //     ))
          );
        });
  }
}
